<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>主页</title>
    {include file="public/css" /}
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeIn">
        <!--顶部通知-->
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-content text-center p-md">
                        <h2><span class="text-navy">W.NK博客后台管理</span>
                        </h2>
                        <div class="alert alert-success alert-dismissable">
                            <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
                            <p>欢迎您登陆 <a class="alert-link" href="">{$Think.session.admin.username}</a>.</p>

                            <p>登陆时间 ：{$Think.session.admin.login_time|transTime}</p>
                            <p>登陆地点 ：{$Think.session.admin.login_ip|getAddressFromIp}</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--网站概况-->
        <div class="row">
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-content text-center p-md">
                        <h4>文章数</h4>
                        <h2>{$article_count}</h2>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-content text-center p-md">
                        <h4>登陆人数</h4>
                        <h2>{$user_count}</h2>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-content text-center p-md">
                        <h4>评论数</h4>
                        <h2>{$comment_count}</h2>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-content text-center p-md">
                        <h4>留言数</h4>
                        <h2>{$message_count}</h2>
                    </div>
                </div>
            </div>
        </div>
        <!--最新发表-->
        <div class="row">
            <div class="col-sm-9">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>最新发表</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div class="list-group">
                            {foreach name="article_list" item="article"}
                            <a class="list-group-item" href="javascript:void(0)">
                                    {notempty name="article.nums"}<span class="badge badge-danger">{$article.nums}新评</span>{/notempty}
                                    <h3 class="list-group-item-heading">{$article.title}</h3>
                                    <p class="list-group-item-text">{$article.description}</p>
                                    <p>{$article.update_time|transTime}</p>
                                </a> {/foreach}
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>快捷操作</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                            <a class="close-link">
                                <i class="fa fa-times"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <div>
                            <a href="{:url('admin/article/add')}" class="btn btn-block btn-outline btn-primary">发布文章</a>
                        </div>
                        <div>
                            <a href="{:url('admin/message/index')}" class="btn btn-block btn-outline btn-primary">查看留言</a>
                        </div>
                        <div>
                            <a href="{:url('admin/comment/index')}" class="btn btn-block btn-outline btn-primary">查看评论</a>
                        </div>
                        <div>
                            <a href="{:url('admin/config/conf')}" class="btn btn-block btn-outline btn-primary">网站设置</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    {include file="public/js" /}
</body>

</html>